﻿Imports FinanceiroDAL
Public Class MovimentoContasBLL
    Dim objDAL As New MovimentoContasDAL
#Region "Propriedades"
    Property movcodigo As Integer
    Property movoperacao As String
    Property movdtemissao As Date
    Property ccccodigo As Integer
    Property concodigo As Integer
    Property pagcodigo As Integer
    Property referencia As String
    Property bolcheque As String
    Property dtlancamento As Date
    Property valor As Decimal
    Property obs As String
#End Region
#Region "Construtores"
    Sub New()
    End Sub
    'Sub New(ByVal codigo As Integer)
    '    carrega(codigo)
    'End Sub
    Sub New(ByVal movcod As Integer, ByVal movoper As String, ByVal movdtemis As Date, ByVal ccc As Integer, ByVal concod As Integer,
            ByVal pagcod As Integer, ByVal refer As String, ByVal bolcheq As String, ByVal dtlancam As Date, ByVal val As Decimal, ByVal obser As String)
        Me.movcodigo = movcod
        Me.movoperacao = movoper
        Me.movdtemissao = movdtemis
        Me.ccccodigo = ccc
        Me.concodigo = concod
        Me.pagcodigo = pagcod
        Me.referencia = refer
        Me.bolcheque = bolcheq
        Me.dtlancamento = dtlancam
        Me.valor = val
        Me.obs = obser
    End Sub
#End Region
#Region "Limpar"
    Sub limpar()
        Me.movcodigo = Nothing
        Me.movoperacao = Nothing
        Me.movdtemissao = Nothing
        Me.ccccodigo = Nothing
        Me.concodigo = Nothing
        Me.pagcodigo = Nothing
        Me.referencia = Nothing
        Me.bolcheque = Nothing
        Me.dtlancamento = Nothing
        Me.valor = Nothing
        Me.obs = Nothing
    End Sub
#End Region
#Region "Métodos"
    Function Inserir() As Integer
        Try
            objDAL = New MovimentoContasDAL
            Me.movcodigo = objDAL.inserirConta(Me.movcodigo, Me.movoperacao, Me.movdtemissao, Me.ccccodigo, Me.concodigo, Me.pagcodigo,
                                               Me.referencia, Me.bolcheque, Me.dtlancamento, Me.valor, Me.obs)
        Catch ex As Exception
            Throw ex
        Finally
            objDAL = Nothing
        End Try
        Return Me.movcodigo
    End Function
#End Region
#Region "Buscar CBFiltro"
    Function localizar(ByVal descricao As String, tipo As Integer) As DataTable
        Dim ret As DataTable
        Try
            objDAL = New MovimentoContasDAL
            ret = objDAL.localizar(descricao, tipo)
        Catch ex As Exception
            Throw ex
        Finally
            objDAL = Nothing
        End Try
        Return ret
    End Function
#End Region
End Class
